﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DC2010.Objects.Base;
using DC2010.Objects.Structures;
using DC2010_EditorData.Dialogs;

namespace DC2010_EditorData
{
    public partial class TeleportForm : Form
    {
        public TileTeleportInfo TileTeleportInfo { get; set; }

        public TeleportForm()
        {
            InitializeComponent();
        }

        public TeleportForm(TileTeleportInfo tti) : this()
        {
            TileTeleportInfo = tti;

            FillBaseObjectTypes();
        }

        public void FillBaseObjectTypes()
        {
            comboBox1.Items.Clear();

            comboBox1.DataSource = Enum.GetNames(typeof(BaseObjectType));
        }

        private void TeleportForm_Load(object sender, EventArgs e)
        {
            comboBox1.Text = TileTeleportInfo.TeleportableTypes.ToString();
        }

        private void TeleportForm_FormClosed(object sender, FormClosedEventArgs e)
        {
            TileTeleportInfo.TeleportableTypes = (BaseObjectType)Enum.Parse(typeof(BaseObjectType), comboBox1.Text);

        }

        private void button2_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            DungeonLocForm dlf = new DungeonLocForm(TileTeleportInfo.Target);
            dlf.ShowDialog();
        }

    }
}
